#include <stdio.h>

#define N 100

int n,c,a[N],t[N];

void output()
{
	for (int i = 0; i < n; ++i)
	{
		if(t[i]) printf("%d ",a[i]);
	}
	printf("\n");
}

void backtrace(int id,int sum)
{
	if(id > n || sum > c) return;
	if(sum == c)
	{
		t[n] = 1;
		output();
		return;
	}
	if(id == n) return;
	t[id] = 1;
	backtrace(id+1,sum+a[id]);
	t[id] = 0;
	backtrace(id+1,sum);
}

int main(int argc, char const *argv[])
{
	scanf("%d%d",&n,&c);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d",&a[i]);
		t[i] = 0;
	}
	backtrace(0,0);
	return 0;
}